import { reqCategoryList, reqGetBannerList, reqGetFloorList } from '@/api'
const state = {
    categoryList: [],
    bannerUrl: [],
    floorList: []
}
const mutations = {
    CateList(state, categoryList) {
        state.categoryList = categoryList
    },
    BanerUrl(state, bannerUrl) {
        state.bannerUrl = bannerUrl
        console.log(bannerUrl);
    },
    FLOORLIST(state, floorList) {
        state.floorList = floorList
    }
}
const actions = {
    async categoryList({ commit }) {
        let list = await reqCategoryList()
        if (list.code === 200) {
            commit('CateList', list.data)
        }
    },
    async getBannerList({ commit }) {
        let data = await reqGetBannerList()
        console.log(data);
        if (data.code === 200) {
            console.log(data.data);
            commit('BanerUrl', data.data)
        }
    },
    async reqGetFloorList({ commit }) {
        let list = await reqGetFloorList()
        if (list.code === 200) {
            commit('FLOORLIST', list.data)
        }
    }
}
const getters = {}
export default {
    state,
    mutations,
    actions,
    getters
}